#!/bin/bash

# 创建 SSL 目录
mkdir -p ssl

# 生成自签名证书
openssl req -x509 -nodes -days 365 -newkey rsa:2048 \
    -keyout ssl/nginx.key \
    -out ssl/nginx.crt \
    -subj "/C=CN/ST=Beijing/L=Beijing/O=ChatRobot/OU=IT/CN=localhost"

echo "SSL 证书已生成在 ssl/ 目录中"
echo "证书文件: ssl/nginx.crt"
echo "私钥文件: ssl/nginx.key" 